
package ProOF.apl.problems.real.functions;

import ProOF.com.LinkerParameters;
import java.lang.Math;
/**
 *
 * @author Lucas
 */
public class RealFuncWP extends aRealFunction{
	
	private double A = 2.5;
	private double B = 5;
	private double z = 30;
	
	@Override
	public void parameters(LinkerParameters link) throws Exception {

	}
	
	@Override
	public int dimension() {
		return 4;
	}
	
	@Override
	public double min( int i ) {
		return -10;
	}
	
	@Override
	public double max( int i ) {
		return 10;
	}

	@Override
	public double f(double[] x) throws Exception {
		check(x);
		return 100*Math.pow((x[1] - x[0]*x[0]),2) + Math.pow(1 - x[0], 2) + 90*Math.pow(x[3] - x[2]*x[2], 2) +
                Math.pow(1 - x[2], 2) + 10.1*(Math.pow(x[1]-1, 2) + Math.pow(x[3] - 1, 2)) +
                19.8*(x[1] - 1)*(x[3] - 1);
	}

	@Override
	public String name() {
		return "WP";
	}

	@Override
	public String description() {
		return "Wood's Function";
	}	
}
